home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / oort / validate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.9 KB  |  85 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*------------------------------------------------------------------------------
  18.  *
  19.  * @(#) - Oort - Host validation routines
  20.  *
  21.  * $Id: validate.h,v 1.2 1994/01/28 00:22:33 mtj Exp $
  22.  *
  23.  * Chris Fouts - May, 1993.
  24.  *
  25.  *----------------------------------------------------------------------------*/
  26.  
  27. #if !defined(VALIDATE_H)
  28.  
  29. #define VALIDATE_H
  30.  
  31. #define    NG_MIN_TTL    1
  32. #define    NG_DEFAULT_TTL    8
  33. #define    NG_MAX_TTL    32
  34. #define    MAXPLAYERS    40
  35.  
  36. typedef    long    ngMagic ;
  37.  
  38.  
  39. struct ngAck {
  40.     ngMagic            magic ;
  41.     long            id ;
  42.     long            ackId ;
  43.     unsigned short    key ;
  44.     } ;
  45.  
  46.  
  47. struct ngCensus {
  48.     ngMagic            magic ;
  49.     long            id ;
  50.     long            nPlayers ;
  51.     unsigned long        chksum ;
  52.     unsigned long        chkxor ;
  53.     long            list[MAXPLAYERS] ;
  54.     } ;
  55.  
  56.  
  57. /* BEGIN PROTOTYPES validate.c */
  58. void                    checkToSendCensus( void ) ;
  59. struct ngCensusList *   findHostCensus( long id ) ;
  60. void                    ngAcknowledge( long hostId, unsigned short key ) ;
  61. void                    ngAddHostToCensus( long id ) ;
  62. void                    ngDprintf( char *fmt, ... ) ;
  63. void                    ngDropHost( long hostId ) ;
  64. void                    ngDroppedByHost( long hostId ) ;
  65. char                   *ngHostNameFromId( long id ) ;
  66. void                    ngInit( long id, unsigned short key, char *name,
  67.                             ngMagic drop, ngMagic invalidate, ngMagic census,
  68.                             ngMagic ack, ngMagic quit, char *logFile ) ;
  69. void                    ngInitCensusPacket( long id ) ;
  70. void                    ngInvalidateHost( long hostId ) ;
  71. char *                  ngPrintTime( void ) ;
  72. void                    ngQuitHost( long hostId ) ;
  73. void                    ngRegisterKey( unsigned short key ) ;
  74. void                    ngRemoveHost( long hostId ) ;
  75. void                    ngRemoveHostFromCensus( long id ) ;
  76. void                    ngSendQuitPacket( void ) ;
  77. int                     ngValidHost( long hostId ) ;
  78. int                     ngValidKeyedHost( long hostId, unsigned short key ) ;
  79. char *                  printDate( void ) ;
  80. void                    processNgCensus( struct ngCensus *input ) ;
  81. void                    validationSummary( void ) ;
  82. /* END PROTOTYPES validate.c */
  83.  
  84. #endif /* !defined(VALIDATE_H) */
  85.